import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopOrderItemController } from '../../../controllers';
const uctoominishopOrderItemRouter = new Router();
const minishopOrderItemController = new uctooMinishopOrderItemController();

uctoominishopOrderItemRouter.post('/add', requireUser, minishopOrderItemController.add);
uctoominishopOrderItemRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_order_item'), minishopOrderItemController.edit);
uctoominishopOrderItemRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_order_item'), minishopOrderItemController.delete);

//For getting minishopOrderItem with permission control
uctoominishopOrderItemRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_order_item'), minishopOrderItemController.getSingle);
uctoominishopOrderItemRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_order_item'), minishopOrderItemController.getMany);
uctoominishopOrderItemRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_order_item'), minishopOrderItemController.getMany);

//#endregion AutoCreateCode
export default uctoominishopOrderItemRouter;
